Change: enable running with no config if no plugin needs a config #726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Additional edits to poc_plugins_config_file. Allows Troubadix to run without a config file if no plugins require it.
Checks if any of the plugins that are part of the current run need the config, and only then loads the toml file.
Why
Alternative to placing an empty default config in the repo, so that Troubadix does not crash even if no config would have been required. Maintains the same level of security by not allowing plugins that require config to accidentally run without one.
Running Troubadix
Ok
Only config free plugins:
with default config.
./troubadix.toml
can point to nothing or actual configtroubadix --include-tests <plugins_without_config> -d ~/gb/vulnerability-tests/nasl
manual config. Path can point to nothing or actual config
troubadix --include-tests <plugins_without_config> -d ~/gb/vulnerability-tests/nasl --config troubadix.toml
Plugins that require config
with default config when
./troubadix.toml
points to actual configtroubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl
manual config and path points to actual config
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl --config troubadix.toml
Not Ok
with default config if
./troubadix.toml
does not existtroubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl
manual config and path pointing to non-existent file
troubadix --include-tests <plugins_with_config> -d ~/gb/vulnerability-tests/nasl --config fake_file
References
Checklist